#include<iostream>
using namespace std;

class V
{
	public:
		V& operator=(const V& v)
		{
			cout << "V copied" << endl;
		}
};

class B1 : public virtual V
{
	public:
		B1& operator=(const B1& b1)
		{
			V::operator=(b1);
			cout << "B1 copied" <<endl;
		}
};

class B2 : public virtual V
{
	public:
		B2& operator=(const B2& b2)
		{
			V::operator=(b2);
			cout << "B2 copied" <<endl;
		}
};

class C : public B1, public B2
{
	public:
		C& operator=(const C& c)
		{
			B1::operator=(c);
			B2::operator=(c);
			cout << "C copied" <<endl;
		}
};

int main(int argc, char *argv[])
{
	C c1,c2;
	//the virtual base class will be copied twice
	c2 = c1;
	return 0;
}

